package com.qk.mapper;

import com.qk.entity.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {

@Insert("insert into dept(name,status,create_time,update_time) values(#{name},#{status},#{createTime},#{updateTime})")
    void insert(Dept dept);


    List<Dept> selectlist(String name, Integer status);

    /**
     * id
     */
    @Select("select id, name, status, create_time, update_time from dept where id=#{id}")
    Dept getById(Integer id);

//    @Update("update dept set name=#{name},status=#{status},update_time=#{updateTime} where id=#{id}")
    void update(Dept dept);

    @Delete("delete from dept where id=#{id}")
    void deleteid(Integer id);

    @Select("select id, name, status, create_time, update_time from dept where status=1")
    List<Dept> getByStatus();
}
